**********************
**********************
*LABORATORY SESSION 2*
**********************
**********************

task-a:
x = [4 1 6 8 2 7 9];
-> x(3) --> 6
-> x(1:5) --> [4 1 6 8 2]
-> x(4:end) --> [8 2 7 9]
-> x(end:-2:1) --> [9 2 6 4]
-> x([1, 5, 3, 2, 2]) --> [4 2 6 1 1]
-> sum(x) --> 37

task-b:
-> x = (16:2:49);

task-c: 
x = [2 9 7 5 3];
-> x-11
-> x.*2
-> x.^2
-> x'

task-d: 
x = [3 2 6 8]'; y = [4 1 3 5]';
-> y+sum(x)
-> x.^y
-> x./y

task-e: 
z = zeros(1,50); o = ones(1,50); r = round(rand(1,50)*10);
-> figure;
   hold on;
   plot(z, 'b'); plot(o,'r'); plot(r,'k');
   hold off;

   figure;
   hold on;
   stem(z, 'b'); stem(o,'r'); stem(r,'k');
   hold off;  
   
-> figure;   
   subplot(2,1,1)
   hold on;
   plot(z, 'b'); plot(o,'r'); plot(r,'k');
   hold off;
   subplot(2,1,2)   
   hold on;
   stem(z, 'b'); stem(o,'r'); stem(r,'k');
   hold off;  
   
task-f:
M = [2 4 1; 6 7 2; 3 5 9];
-> Msub = M(1:2,:);
-> sum(M(1,:)); sum(M(2,:)); sum(M(3,:));
   sum(M(:,1)); sum(M(:,2)); sum(M(:,3));
   
